<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
					
					
					// 1.
					var str1 = new String("abc123")
					var str2 = "abc123";
					
					// 2. 
					console.log(str1.length)
		
					// 3. 字符串的查找
					var str3 = "adsfadsf man asfadfadw242342342 man  34  woman 234"
					// 得到指定位置的字符
					console.log(str3.charAt(2));
					console.log(str3.indexOf("man")) // 9
					console.log(str3.indexOf("man",15)) // 从位置15往后找
					console.log(str3.lastIndexOf("man")) // 从后往前找
					
					// 4. 字符串的截取
					var str4 = "abcdefghijk";
					// slice(开始的索引,终止的索引)
					console.log(str4.slice(3,7)); // defg
					// substr(开始的索引,截取的长度)
					console.log(str4.substr(3,4));// defg
					// sbustring(开始的索引,终止的索引)
					console.log(str4.substring(3,7));// defg
					
					
					
					
					
				</script>
		
	</body>
</html>
